<template>
  <el-dialog title="编辑分类" :visible.sync="dialogFormVisible" width="30%">
    <el-form :model="form">
      <el-form-item label="分类名称:" :label-width="formLabelWidth">
        <el-input v-model="form.name" autocomplete="off"  @keyup.enter.native="sendData"></el-input>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer" style="display: flex;align-items: center;justify-content: center">
      <el-button @click="dialogFormVisible = false" style="margin-right: 10px">取 消</el-button>
      <el-button type="primary" @click="editData(index,form.name)">保 存</el-button>
    </div>
  </el-dialog>
</template>

<script>
  /*eslint-disable*/
  export default {
    name: "editeCategory",
    data(){
      return{
        index:'',
        add:'',
        dialogFormVisible: false,
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        formLabelWidth: '100px'
      }
    },
    methods: {
      changeVisible(e,index) {
        this.index=index;
        this.dialogFormVisible=true
      },
      editData(index,name){
       let data={
          index,
           name
        };
        this.$emit("editData",data)
      }
    },
  }
</script>

<style scoped>

</style>
